/*
 * Copyright (C) 2023 Volodymyr Atamanenko
 *
 * This software may be modified and distributed under the terms
 * of the MIT license. See the LICENSE file for details.
 */

/**
 * @file  patch.c
 * @brief Patching some of the .so internal functions or bridging them to native
 *        for better compatibility.
 */

#include <kubridge.h>
#include <so_util/so_util.h>

extern so_module so_mod;

int CheckHackProcess(void* obj)
{
   debugPrintf("CheckHackProcess:%d",1);
   return 1;
}

void so_patch(void) {
    // Sample hook
    //hook_addr((uintptr_t)so_symbol(&so_mod, "_ZN8CDataMgr16CheckHackProcessEv"), (uintptr_t)&CheckHackProcess);
    // int* value=(int *)so_symbol(&so_mod, "UseWindowWidth");
    // debugPrintf("UseWindowWidth:%d",*value);
    // *value = 2;
    // *(int *)so_symbol(&so_mod, "UseWindowHeight") = 2;
}
